import 'package:flutter/material.dart';
import '../home/constants.dart' show AppColors;

class Conversation {
  final String avatar;
  final String title;
  final String des;
  final String updateAt;
  final bool isMute;
  final int titleColor;
  final int unreadMsgCount;
  final bool displayDot;


  bool isAvatarFromNet(){
    if (this.avatar.indexOf("http") == 0 || this.avatar.indexOf("https") == 0) {
      return true;
    }
    return false;
  }

  const Conversation({

    @required this.avatar,this.title,this.updateAt,
    this.titleColor = AppColors.ConversationTtiteColor,
    this.des,
    this.isMute = false,
    this.unreadMsgCount = 0,
    this.displayDot : false,
  }) :  assert(avatar != null),
        assert(title != null),
        assert(updateAt != null);
}

const List<Conversation>mockConversation = [
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/women/60.jpg",
    title: "腾讯新闻",
    des: "1234212",
    updateAt: "22:00",
    unreadMsgCount : 11,
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/men/32.jpg",
    title: "腾讯新闻",
    des: "1234212",
    updateAt: "22:00",
    unreadMsgCount : 1,
    isMute : true,
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/women/57.jpg",
    title: "腾讯新闻",
    des: "1234212",
    updateAt: "22:00",
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/men/76.jpg",
    title: "腾讯新闻",
    des: "1234212",
    updateAt: "22:00",
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/men/35.jpg",
    title: "腾讯新闻",
    des: "1234212啥呆发发阿福的数据发哭了多久发",
    updateAt: "22:00",
    isMute : true,
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/women/81.jpg",
    title: "腾讯新闻",
    des: "啥呆发发阿福的数据发哭了多久发dsfadfaf12",
    updateAt: "22:00",
    unreadMsgCount : 82,
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/men/28.jpg",
    title: "腾讯新闻",
    des: "1234212",
    updateAt: "22:00",
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/women/60.jpg",
    title: "腾讯新闻",
    des: "123啥呆发发阿福的数据发哭了多久发asd2",
    updateAt: "22:00",
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/men/71.jpg",
    title: "腾讯新闻",
    des: "是打发啥呆发发阿福的数据发哭了多久发菲法拉克家在干啥里",
    updateAt: "22:00",
    unreadMsgCount : 23,
    isMute : true,
  ),
  const Conversation(
    avatar: "https://randomuser.me/api/portraits/women/68.jpg",
    title: "腾讯新闻",
    des: "1234212",
    updateAt: "22:00",
  ),

];